function AjouterCurrentItemPanier(idtshirt)
{
	var select = document.getElementById('select_taille');
	var nb = document.getElementById('quantite').value;
	var taille = select.options[select.selectedIndex].value;
	
	OuvrirAjouterTshirtPanier(idtshirt, nb, taille);
}

function onClickVignette(idtshirt, idvignette)
{
	var image = document.getElementById('image_moyenne');
	
	image.src = 'tshirts/' + idtshirt + '_infotshirt_' + idvignette + '_moyenne.png';
	image.onclick = function () { OuvrirFicheTshirtById(idtshirt, idvignette); };
}

function UpdateListQuantites()
{
	var select = document.getElementById('select_taille');
	var taille = select.options[select.selectedIndex].value;
	var divid = document.getElementById('tshirtid');
	
	GetPageContent('GET', 'functions/GetListQuantitiesHTMLBySizeAndID.php?size='+taille.toLowerCase()+'&id='+divid.innerHTML, '', UpdateListeQuantitesCallback, 'create', true);	
}
function UpdateListeQuantitesCallback(success, text, param)
{
	var select = document.getElementById('quantite');
	
	while(select.length)
		select.remove(0); 
	
	if(success)
	{
		for(i = 0; i < text; i++)
			select.options[select.options.length] = new Option(i+1,i+1); 
	}
	
	return;
} 